<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        <!-- <p>{{ name }}</p>
        <p>{{ age }}</p> -->
    </div>

    <!-- 定义模板内容 -->
    <template id="hello">
        <div>
            <h1>{{ name }}</h1>
            <hr>
            <h2>{{ age }}</h2>

            <button @click="name='alice'">点我</button>
        </div>
    </template>

    <script>
        new Vue({
            el: '#app',
            data: {
                name: 'tom',
                age: 20
            },
            template: '#hello',
            created(){
                console.log(1111)
            },
            mounted(){
                console.log(2222)
            },
            updated(){
                console.log(3333)
            }
        })
    </script>
</body>
</html>